'use strict';
// Copyright 2014 Blueant Inc. All Rights Reserved.

/**
 * @fileoverview 叛军技能
 * @author sundbcn@gmail.com (sun debing)
 */

var moment = require('moment');
var mongoose = require('mongoose');

var rebelSkillSchema = new mongoose.Schema({
    // 技能id
    skill_type: {
        type: Number,
        require: true
    },

    // 使用次数
    use_times: {
        type: Number,
        default: 0
    }
});

rebelSkillSchema.methods.getSkillUseTimes = function () {
    return this.use_times;
};

rebelSkillSchema.methods.addSkillUseTimes = function () {
    this.use_times++;
};

if (!rebelSkillSchema.options.toJSON) {
    rebelSkillSchema.options.toJSON = {};
}
/* jshint unused:false */
rebelSkillSchema.options.toJSON.transform = function (doc, ret) {
    delete ret._id;
    delete ret.__v;
};

module.exports = rebelSkillSchema;
